<extend name="Public/base"/>

<block name="body">
    <script type="text/javascript" src="__STATIC__/uploadify/jquery.uploadify.min.js"></script>
    <div class="main-title">
        <h2>
            <if condition="ACTION_NAME eq 'add'">
                新增活动
            <else/>
                编辑活动
            </if>
            <button class="btn btn-default btn-return" onclick="javascript:history.back(-1);return false;"><i class="glyphicon glyphicon-share-alt"></i> 返 回</button>
        </h2>
    </div>
    <form action="" method="post" class="form">
        <div class="form-item form-group">
            <label class="item-label">标题<span class="check-tips"></span></label>
            <div class="controls">
                <input type="text" class="text form-control input-large" name="title" value="{$title}">
            </div>
        </div>
        <div class="form-item form-group">
            <label class="item-label">开始时间<span class="check-tips"></span></label>
            <div class="controls">
                <input type="text" class="text form-control input-small time" name="start_time" value="{$start_time}">
            </div>
        </div>
        <div class="form-item form-group">
            <label class="item-label">结束时间<span class="check-tips">(不填写则不结束)</span></label>
            <div class="controls">
                <input type="text" class="text form-control input-small time" name="end_time" value="{$end_time}">
            </div>
        </div>
        <div class="form-item form-group">
            <label class="item-label">初始用户次数<span class="check-tips"></span></label>
            <div class="controls">
                <input type="text" class="text form-control input-large" name="user_times" value="{$user_times|default=1}">
            </div>
        </div>
        <div class="form-item form-group">
            <label class="item-label">分享最大次数<span class="check-tips">分享做多获取次数</span></label>
            <div class="controls">
                <input type="text" class="text form-control input-large" name="share_max" value="{$share_max|default=1}">
            </div>
        </div>
        <div class="form-item form-group">
            <label class="item-label">分享获取<span class="check-tips">每次分享可获得次数</span></label>
            <div class="controls">
                <input type="text" class="text form-control input-large" name="share_plus" value="{$share_plus|default=1}">
            </div>
        </div>
        <div class="form-item form-group">
            <label class="item-label">描述<span class="check-tips"></span></label>
            <div class="controls">
                <label class="input-large">
                    <textarea rows="4" class="form-control" name="detail">{$detail}</textarea>
                </label>
            </div>
        </div>
        <div class="form-item form-group">
            <label class="item-label">奖品概率设置<span class="check-tips">每行一个依次从1等奖到5等奖设置, 每行使用 概率|limit=几个(不设置limit或者limit=0为不限制), 6等奖参与奖自动计算概率</span></label>
            <div class="controls">
                <label class="input-large">
                    <textarea rows="4" class="form-control" name="prize">{$prize}</textarea>
                </label>
            </div>
        </div>
        <div class="form-item form-group">
            <label class="item-label">状态<span class="check-tips"></span></label>
            <label class="radio-inline">
            <input type="radio" name="status" <if condition="$status eq 1 or $status eq ''">checked</if> value="1"  /> 开启
            </label>
            <label class="radio-inline">
            <input type="radio" name="status" <eq name="status" value="0">checked</eq> value="0"  />关闭
            </label>
        </div>
        <div class="form-item form-group form-action">
            <input type="hidden" name="id" value="{$id}" />
            <button class="btn submit-btn ajax-post btn-success btn-block" id="submit" type="submit" target-form="form">确 定</button>
            <!-- <button class="btn btn-return" onclick="javascript:history.back(-1);return false;">返 回</button> -->
        </div>
    </form>
</block>

<block name="script">
     <link href="__STATIC__/datetimepicker/css/datetimepicker.css" rel="stylesheet" type="text/css">
    <php>if(C('COLOR_STYLE')=='blue_color') echo '<link href="__STATIC__/datetimepicker/css/datetimepicker_blue.css" rel="stylesheet" type="text/css">';</php>
    <link href="__STATIC__/datetimepicker/css/dropdown.css" rel="stylesheet" type="text/css">
    <script type="text/javascript" src="__STATIC__/datetimepicker/js/bootstrap-datetimepicker.min.js"></script>
    <script type="text/javascript" src="__STATIC__/datetimepicker/js/locales/bootstrap-datetimepicker.zh-CN.js" charset="UTF-8"></script>
    <script type="text/javascript">
        //导航高亮
        highlight_subnav('{:U('index')}');
         $(function(){
             $('.time').datetimepicker({
                format: 'yyyy-mm-dd hh:ii',
                language:"zh-CN",
                minView:0,
                autoclose:true
            });
        });
    </script>
</block>
